<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<include file="Public/head" />
</head>

<body>
<include file="Public/top" />

<div class="page_minheight">
<div class="login_tit">设置新密码</div>
<div class="page_in margin">
  <form action="" id="vi_form" method="post">
    <div class="ginput_div ginput_div_icon"><i class="icon-mima"></i><input class="ginput" name="password" id="password" type="password" placeholder="请输入密码" onblur="checkpwd()" /></div>
    <div class="ginput_div ginput_div_icon"><i class="icon-mima"></i><input class="ginput" name="password2" id="password_repeat" type="password" placeholder="请再次输入密码" onblur="checkpwd()" /></div>
    <div class="ginput_div"><button type="button" class="login_sub" onclick="dosubmit()">下一步</button></div>
  </form>
</div><!--page_in-->
</div><!--page_minheight-->

<script>
var flag1 = flag2 = false;
function checkpwd(){
	var password = $('#password').val();
	var password_repeat = $('#password_repeat').val();

	if(password == ''){
			layer.alert('密码不能为空', 800);
		return false;
	}else if(password.length<6 || password.length>16){
		
			layer.alert('密码长度必须为6-16位', 800);
		return false;
	}else{
		//$('span[data-tips-for="password"]').css('display','inline');
		//$('span[data-tips-for="password"]').find('i').removeClass('icon-warn');
		//$('span[data-tips-for="password"]').find('i').addClass('icon-loss');
		//$('span[data-tips-for="password"]').find('.txt').empty();
		flag1 = true;
	}
	
	if(password_repeat == ''){
			layer.alert('重复密码不能为空', 800);
		return false;
	}else if(password!=password_repeat){
			layer.alert('两次密码不一样', 800);
		return false;
	}else{
		//$('span[data-tips-for="password_repeat"]').css('display','inline');
		//$('span[data-tips-for="password_repeat"]').find('i').removeClass('icon-warn');
		//$('span[data-tips-for="password_repeat"]').find('i').addClass('icon-loss');
		//$('span[data-tips-for="password_repeat"]').find('.txt').empty();
		flag2 = true;
	}
	return (flag1 && flag2);
}

function show_error(type,msg){
	//$('span[data-tips-for="'+type+'"]').css('display','inline');
	//$('span[data-tips-for="'+type+'"]').find('i').removeClass('icon');
	//$('span[data-tips-for="'+type+'"]').find('i').removeClass('icon-loss');
	//$('span[data-tips-for="'+type+'"]').find('i').addClass('icon-warn');
	//$('span[data-tips-for="'+type+'"]').find('.txt').empty().html(msg);
}

function dosubmit(){
	if(checkpwd()){
		$('#vi_form').submit();
	}
}
</script>

<include file="Public/footer" />
<script src="__STATIC__/js/global_after.js" type="text/javascript"></script>
</body>
</html>